import 'package:day_demo/src/square/square_heading/org_square_editing_heading_widget.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../square_heading_change_trace/kyy_org_square_heading_change_trace_page.dart';
import 'kyy_org_square_heading_logic.dart';
import 'org_squrare_view_heading_widget.dart';

class KyyOrgSquareHeadingPage extends StatefulWidget {
  const KyyOrgSquareHeadingPage({super.key});

  @override
  State<KyyOrgSquareHeadingPage> createState() =>
      _KyyOrgSquareHeadingPageState();
}

class _KyyOrgSquareHeadingPageState extends State<KyyOrgSquareHeadingPage> {
  final logic = Get.put(KyyOrgSquareHeadingLogic());
  final state = Get.find<KyyOrgSquareHeadingLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: const Text(
          '编辑广场名称',
          textAlign: TextAlign.center,
        ),
        actions: [
          TextButton(
              onPressed: () {
                Navigator.push(context, MaterialPageRoute(builder: (ctx) {
                  return const KyyOrgSquareHeadingChangeTracePage();
                }));
              },
              child: Text('修改记录'))
        ],
      ),
      body: OrgSquareEditingHeadingWidget(
        heading: '12345',
      ),
    );
  }

  @override
  void dispose() {
    Get.delete<KyyOrgSquareHeadingLogic>();
    super.dispose();
  }
}
